[6034518] Downgrade TRT support for remote autotuning in Autotune from 10.16 to 10.15#1259
[6034518] Downgrade TRT support for remote autotuning in Autotune from 10.16 to 10.15#1259gcunhase wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com>
Signed-off-by: gcunhase <4861122+gcunhase@users.noreply.github.com>
📝 WalkthroughWalkthroughUpdated TensorRT minimum version requirement for remote autotuning from 10.16 to 10.15 across changelog, documentation, examples, CLI help text, and version checks. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
modelopt/onnx/quantization/autotune/benchmark.py (1)
209-228:⚠️ Potential issue | 🔴 CriticalRemove early return so remote autotuning args are actually applied.
Line 218 returns from
__init__before Line 227 extendsself._base_cmd, so the--remoteAutoTuningConfig/--safeargs never make it into the executed command when TRT >= 10.15. This breaks remote autotuning despite passing the version gate.💡 Proposed fix
- trtexec_args = self.trtexec_args or [] + trtexec_args = list(self.trtexec_args or []) has_remote_config = any("--remoteAutoTuningConfig" in arg for arg in trtexec_args) if has_remote_config: try: _check_for_tensorrt(min_version="10.15") self.logger.debug("TensorRT Python API version >= 10.15 detected") if "--safe" not in trtexec_args: self.logger.warning( "Remote autotuning requires '--safe' to be set. Adding it to trtexec arguments." ) - self.trtexec_args.append("--safe") - return + trtexec_args.append("--safe") except ImportError: self.logger.warning( "Remote autotuning is not supported with TensorRT version < 10.15. " "Removing --remoteAutoTuningConfig from trtexec arguments" ) trtexec_args = [ arg for arg in trtexec_args if "--remoteAutoTuningConfig" not in arg ] self._base_cmd.extend(trtexec_args)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@modelopt/onnx/quantization/autotune/benchmark.py` around lines 209 - 228, The constructor's remote-autotuning branch returns early so trtexec args like "--safe" or "--remoteAutoTuningConfig" never get appended to the final command; remove the early return in the block that calls _check_for_tensorrt(min_version="10.15") and instead ensure any modifications to self.trtexec_args (and filtered local trtexec_args) are followed by extending self._base_cmd with those trtexec_args so the arguments are applied; locate the logic around _check_for_tensorrt, self.trtexec_args, trtexec_args and self._base_cmd in the __init__ of the Benchmark class and adjust flow so the successful TensorRT path does not exit before self._base_cmd.extend(trtexec_args) executes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@modelopt/onnx/quantization/autotune/benchmark.py`:
- Around line 209-228: The constructor's remote-autotuning branch returns early
so trtexec args like "--safe" or "--remoteAutoTuningConfig" never get appended
to the final command; remove the early return in the block that calls
_check_for_tensorrt(min_version="10.15") and instead ensure any modifications to
self.trtexec_args (and filtered local trtexec_args) are followed by extending
self._base_cmd with those trtexec_args so the arguments are applied; locate the
logic around _check_for_tensorrt, self.trtexec_args, trtexec_args and
self._base_cmd in the __init__ of the Benchmark class and adjust flow so the
successful TensorRT path does not exit before
self._base_cmd.extend(trtexec_args) executes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: aca1a5f5-c803-49d9-8889-37357600cffb
📒 Files selected for processing (5)
CHANGELOG.rstdocs/source/guides/9_autotune.rstexamples/onnx_ptq/autotune/README.mdmodelopt/onnx/quantization/__main__.pymodelopt/onnx/quantization/autotune/benchmark.py
|
PR #1259 Review: Downgrade TRT support for remote autotuning from 10.16 to 10.15 Verdict: Request Changes — core fix is correct, but docs have formatting issues and there's a code/doc inconsistency.
Docs (both RST and README) now state --safe --skipInference must be enabled, but benchmark.py:211-215 only auto-adds --safe — no check or auto-add for --skipInference: if "--safe" not in trtexec_args:
self.logger.warning(...)
self.trtexec_args.append("--safe")
# No equivalent for --skipInferenceEither:
The updated help says "Only relevant with the 'trtexec' workflow enabled" — would be clearer as "Only relevant when --use_trtexec is set" since that's the actual flag name. What looks good
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1259 +/- ##
==========================================
+ Coverage 76.90% 77.45% +0.54%
==========================================
Files 350 350
Lines 40524 40524
==========================================
+ Hits 31166 31388 +222
+ Misses 9358 9136 -222
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What does this PR do?
Type of change: Bug fix
Remote autotuning is supported in TensorRT from version 10.15, but fails with Autotune as it's checking for 10.16+. This PR fixes that check and updates documentation accordingly.
Usage
# Add a code snippet demonstrating how to use thisTesting
See bug 6034518.
Before your PR is "Ready for review"
CONTRIBUTING.md: N/ASummary by CodeRabbit
Documentation
Updates